<!--
 * @Author: zqx me_zqx@163.com
 * @Date: 2025-08-19 16:33:13
 * @LastEditors: zqx me_zqx@163.com
 * @LastEditTime: 2025-08-27 10:10:58
 * @FilePath: /XMate-h5/src/views/appDownload/index.vue
 * @Description: 
 * 
 * Copyright (c) 2025 by ${git_name_email}, All Rights Reserved. 
-->
<template>
  <div class="w-full h-full flex flex-col justify-center items-center">
    <img src="@/icons/svg/appDownload/app_bg.svg" alt="" />
    <p class="mt-8 text-gray-400 text-sm">Voice driven Intelligence,sales-led future.</p>
    <h1 class="text-2xl font-bold mt-2 mb-6">声启智慧，销领未来</h1>
    <h2 class="text-xs mb-12 text-gray-500">每次沟通都是进步，每个客户都是机遇</h2>
    <van-button
      class="py-4 px-10 rounded-md text-white cursor-auto bg-yxt-blue"
      @click="onClickDownload"
      color="#436BFF"
      >{{ isAndroid() ? "Android版本" : "iOS版本" }}</van-button
    >
  </div>
</template>

<script setup>
import { showToast, showLoadingToast, closeToast } from "vant";
import { useRoute } from "vue-router";
import { getAppVersion } from "@/services/myXmate";

const route = useRoute();

let isAndroid = () => {
  if (/android/i.test(navigator.userAgent)) {
    return true;
  }

  if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
    return false;
  }
  return true;
};
let { isTest } = route.query;

const pgyurl = "https://www.pgyer.com/xXybfff7";
const appStoreUrl = "https://apps.apple.com/cn/app/salesmate/id6738576286";
const android_pgy_url = "https://www.pgyer.com/4uxr0aY6";

const iosUrl = isTest ? pgyurl : appStoreUrl;

async function onClickDownload() {
  if (isAndroid()) {
    window.open(android_pgy_url, "_blank");
  } else {
    window.open(iosUrl, "_blank");
  }
}
</script>

<style lang="less" scoped></style>
